/**
 * 
 */
package org.t2.backstage.module.hotfix.service;

import java.util.List;

import org.banish.sql.core.util.QuerySet;
import org.gaming.backstage.PageData;
import org.gaming.service.service.AbstractService;
import org.springframework.stereotype.Service;
import org.t2.backstage.module.hotfix.model.FixDesignResult;

/**
 * @author YY
 *
 */
@Service
public class FixDesignResultService extends AbstractService<FixDesignResult> {

	public PageData<FixDesignResult> query(QuerySet querySet) {
		List<FixDesignResult> list = this.repository().getBaseDao().queryListWhere(querySet.getWhere(), querySet.getParams());
		
		PageData<FixDesignResult> pageData = new PageData<>();
		pageData.setCount(this.repository().getBaseDao().countWhere(querySet.getCountWhere(), querySet.getCountParams()));
		pageData.setData(list);
		return pageData;
	}
	
	public List<FixDesignResult> queryByFixId(long fixId) {
		QuerySet querySet = new QuerySet();
		querySet.addCondition("fix_id = ?", fixId);
		querySet.formWhere();
		
		return this.repository().getBaseDao().queryListWhere(querySet.getWhere(), querySet.getParams());
	}

	@Override
	public void mergeServer(int mergeDbZoneId) {
		//不必理会
	}
	
	public void insertAll(List<FixDesignResult> result) {
		this.repository().insertAll(result);
	}
	
	public void updateAll(List<FixDesignResult> result) {
		this.repository().updateAll(result);
	}
}
